<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpaintengine.cpp -->
  <title>QPaintEngine Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPaintEngine</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPaintEngine Class</h1>
<!-- $$$QPaintEngine-brief -->
<p>The QPaintEngine class provides an abstract definition of how <a href="qpainter.html">QPainter</a> draws to a given device on a given platform. <a href="#details">More...</a></p>
<!-- @@@QPaintEngine -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPaintEngine&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul>
<li><a href="qpaintengine-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#DirtyFlag-enum">DirtyFlag</a></b> { DirtyPen, DirtyBrush, DirtyBrushOrigin, DirtyFont, DirtyBackground, &hellip;, AllDirty }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#DirtyFlag-enum">DirtyFlags</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#PaintEngineFeature-enum">PaintEngineFeature</a></b> { AlphaBlend, Antialiasing, BlendModes, BrushStroke, ConicalGradientFill, &hellip;, AllFeatures }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#PaintEngineFeature-enum">PaintEngineFeatures</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#PolygonDrawMode-enum">PolygonDrawMode</a></b> { OddEvenMode, WindingMode, ConvexMode, PolylineMode }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#Type-enum">Type</a></b> { X11, Windows, MacPrinter, CoreGraphics, QuickDraw, &hellip;, Direct2D }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#QPaintEngine">QPaintEngine</a></b>(QPaintEngine::PaintEngineFeatures <i>caps</i> = PaintEngineFeatures())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#dtor.QPaintEngine">~QPaintEngine</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#begin">begin</a></b>(QPaintDevice *<i>pdev</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawEllipse">drawEllipse</a></b>(const QRectF &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawEllipse-1">drawEllipse</a></b>(const QRect &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawImage">drawImage</a></b>(const QRectF &amp;<i>rectangle</i>, const QImage &amp;<i>image</i>, const QRectF &amp;<i>sr</i>, Qt::ImageConversionFlags <i>flags</i> = Qt::AutoColor)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawLines">drawLines</a></b>(const QLineF *<i>lines</i>, int <i>lineCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawLines-1">drawLines</a></b>(const QLine *<i>lines</i>, int <i>lineCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawPath">drawPath</a></b>(const QPainterPath &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawPixmap">drawPixmap</a></b>(const QRectF &amp;<i>r</i>, const QPixmap &amp;<i>pm</i>, const QRectF &amp;<i>sr</i>) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawPoints">drawPoints</a></b>(const QPointF *<i>points</i>, int <i>pointCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawPoints-1">drawPoints</a></b>(const QPoint *<i>points</i>, int <i>pointCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawPolygon">drawPolygon</a></b>(const QPointF *<i>points</i>, int <i>pointCount</i>, QPaintEngine::PolygonDrawMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawPolygon-1">drawPolygon</a></b>(const QPoint *<i>points</i>, int <i>pointCount</i>, QPaintEngine::PolygonDrawMode <i>mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawRects">drawRects</a></b>(const QRectF *<i>rects</i>, int <i>rectCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawRects-1">drawRects</a></b>(const QRect *<i>rects</i>, int <i>rectCount</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawTextItem">drawTextItem</a></b>(const QPointF &amp;<i>p</i>, const QTextItem &amp;<i>textItem</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#drawTiledPixmap">drawTiledPixmap</a></b>(const QRectF &amp;<i>rect</i>, const QPixmap &amp;<i>pixmap</i>, const QPointF &amp;<i>p</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#end">end</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#hasFeature">hasFeature</a></b>(QPaintEngine::PaintEngineFeatures <i>feature</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#isActive">isActive</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPaintDevice *</td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#paintDevice">paintDevice</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainter *</td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#painter">painter</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#setActive">setActive</a></b>(bool <i>state</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QPaintEngine::Type </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#type">type</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpaintengine.html#updateState">updateState</a></b>(const QPaintEngineState &amp;<i>state</i>) = 0</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QPaintEngine-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>Qt provides several premade implementations of QPaintEngine for the different painter backends we support. The primary paint engine provided is the raster paint engine, which contains a software rasterizer which supports the full feature set on all supported platforms. This is the default for painting on <a href="../qtwidgets/qwidget.html">QWidget</a>-based classes in e.g&#x2e; on Windows, X11 and macOS, it is the backend for painting on <a href="qimage.html">QImage</a> and it is used as a fallback for paint engines that do not support a certain capability. In addition we provide QPaintEngine implementations for OpenGL (accessible through QGLWidget) and printing (which allows using <a href="qpainter.html">QPainter</a> to draw on a QPrinter object).</p>
<p>If one wants to use <a href="qpainter.html">QPainter</a> to draw to a different backend, one must subclass QPaintEngine and reimplement all its virtual functions. The QPaintEngine implementation is then made available by subclassing <a href="qpaintdevice.html">QPaintDevice</a> and reimplementing the virtual function <a href="qpaintdevice.html#paintEngine">QPaintDevice::paintEngine</a>().</p>
<p>QPaintEngine is created and owned by the <a href="qpaintdevice.html">QPaintDevice</a> that created it.</p>
</div>
<p><b>See also </b><a href="qpainter.html">QPainter</a>, <a href="qpaintdevice.html#paintEngine">QPaintDevice::paintEngine</a>(), and <a href="paintsystem.html">Paint System</a>.</p>
<!-- @@@QPaintEngine -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DirtyFlag$$$DirtyPen$$$DirtyBrush$$$DirtyBrushOrigin$$$DirtyFont$$$DirtyBackground$$$DirtyBackgroundMode$$$DirtyTransform$$$DirtyClipRegion$$$DirtyClipPath$$$DirtyHints$$$DirtyCompositionMode$$$DirtyClipEnabled$$$DirtyOpacity$$$AllDirty -->
<h3 class="flags" id="DirtyFlag-enum"><a name="DirtyFlag-enum"></a>enum QPaintEngine::<span class="name">DirtyFlag</span><br/>flags QPaintEngine::<span class="name">DirtyFlags</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyPen</code></td><td class="topAlign tblval"><code>0x0001</code></td><td class="topAlign">The pen is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyBrush</code></td><td class="topAlign tblval"><code>0x0002</code></td><td class="topAlign">The brush is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyBrushOrigin</code></td><td class="topAlign tblval"><code>0x0004</code></td><td class="topAlign">The brush origin is dirty and needs to updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyFont</code></td><td class="topAlign tblval"><code>0x0008</code></td><td class="topAlign">The font is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyBackground</code></td><td class="topAlign tblval"><code>0x0010</code></td><td class="topAlign">The background is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyBackgroundMode</code></td><td class="topAlign tblval"><code>0x0020</code></td><td class="topAlign">The background mode is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyTransform</code></td><td class="topAlign tblval"><code>0x0040</code></td><td class="topAlign">The transform is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyClipRegion</code></td><td class="topAlign tblval"><code>0x0080</code></td><td class="topAlign">The clip region is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyClipPath</code></td><td class="topAlign tblval"><code>0x0100</code></td><td class="topAlign">The clip path is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyHints</code></td><td class="topAlign tblval"><code>0x0200</code></td><td class="topAlign">The render hints is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyCompositionMode</code></td><td class="topAlign tblval"><code>0x0400</code></td><td class="topAlign">The composition mode is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyClipEnabled</code></td><td class="topAlign tblval"><code>0x0800</code></td><td class="topAlign">Whether clipping is enabled or not is dirty and needs to be updated.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::DirtyOpacity</code></td><td class="topAlign tblval"><code>0x1000</code></td><td class="topAlign">The constant opacity has changed and needs to be updated as part of the state change in <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::AllDirty</code></td><td class="topAlign tblval"><code>0xffff</code></td><td class="topAlign">Convenience enum used internally.</td></tr>
</table></div>
<p>These types are used by <a href="qpainter.html">QPainter</a> to trigger lazy updates of the various states in the <a href="qpaintengine.html">QPaintEngine</a> using <a href="qpaintengine.html#updateState">QPaintEngine::updateState</a>().</p>
<p>A paint engine must update every dirty state.</p>
<p>The DirtyFlags type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;DirtyFlag&gt;. It stores an OR combination of DirtyFlag values.</p>
<!-- @@@DirtyFlag -->
<!-- $$$PaintEngineFeature$$$PrimitiveTransform$$$PatternTransform$$$PixmapTransform$$$PatternBrush$$$LinearGradientFill$$$RadialGradientFill$$$ConicalGradientFill$$$AlphaBlend$$$PorterDuff$$$PainterPaths$$$Antialiasing$$$BrushStroke$$$ConstantOpacity$$$MaskedBrush$$$PerspectiveTransform$$$BlendModes$$$ObjectBoundingModeGradients$$$RasterOpModes$$$PaintOutsidePaintEvent$$$AllFeatures -->
<h3 class="flags" id="PaintEngineFeature-enum"><a name="PaintEngineFeature-enum"></a>enum QPaintEngine::<span class="name">PaintEngineFeature</span><br/>flags QPaintEngine::<span class="name">PaintEngineFeatures</span></h3>
<p>This enum is used to describe the features or capabilities that the paint engine has. If a feature is not supported by the engine, <a href="qpainter.html">QPainter</a> will do a best effort to emulate that feature through other means and pass on an alpha blended <a href="qimage.html">QImage</a> to the engine with the emulated results. Some features cannot be emulated: AlphaBlend and PorterDuff.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPaintEngine::AlphaBlend</code></td><td class="topAlign tblval"><code>0x00000080</code></td><td class="topAlign">The engine can alpha blend primitives.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Antialiasing</code></td><td class="topAlign tblval"><code>0x00000400</code></td><td class="topAlign">The engine can use antialising to improve the appearance of rendered primitives.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::BlendModes</code></td><td class="topAlign tblval"><code>0x00008000</code></td><td class="topAlign">The engine supports blending modes.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::BrushStroke</code></td><td class="topAlign tblval"><code>0x00000800</code></td><td class="topAlign">The engine supports drawing strokes that contain brushes as fills, not just solid colors (e.g&#x2e; a dashed gradient line of width 2).</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::ConicalGradientFill</code></td><td class="topAlign tblval"><code>0x00000040</code></td><td class="topAlign">The engine supports conical gradient fills.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::ConstantOpacity</code></td><td class="topAlign tblval"><code>0x00001000</code></td><td class="topAlign">The engine supports the feature provided by <a href="qpainter.html#setOpacity">QPainter::setOpacity</a>().</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::LinearGradientFill</code></td><td class="topAlign tblval"><code>0x00000010</code></td><td class="topAlign">The engine supports linear gradient fills.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::MaskedBrush</code></td><td class="topAlign tblval"><code>0x00002000</code></td><td class="topAlign">The engine is capable of rendering brushes that has a texture with an alpha channel or a mask.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::ObjectBoundingModeGradients</code></td><td class="topAlign tblval"><code>0x00010000</code></td><td class="topAlign">The engine has native support for gradients with coordinate mode <a href="qgradient.html#CoordinateMode-enum">QGradient::ObjectBoundingMode</a>. Otherwise, if QPaintEngine::PatternTransform is supported, object bounding mode gradients are converted to gradients with coordinate mode <a href="qgradient.html#CoordinateMode-enum">QGradient::LogicalMode</a> and a brush transform for the coordinate mapping.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PainterPaths</code></td><td class="topAlign tblval"><code>0x00000200</code></td><td class="topAlign">The engine has path support.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PaintOutsidePaintEvent</code></td><td class="topAlign tblval"><code>0x20000000</code></td><td class="topAlign">The engine is capable of painting outside of paint events.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PatternBrush</code></td><td class="topAlign tblval"><code>0x00000008</code></td><td class="topAlign">The engine is capable of rendering brushes with the brush patterns specified in <a href="../qtcore/qt.html#BrushStyle-enum">Qt::BrushStyle</a>.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PatternTransform</code></td><td class="topAlign tblval"><code>0x00000002</code></td><td class="topAlign">The engine has support for transforming brush patterns.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PerspectiveTransform</code></td><td class="topAlign tblval"><code>0x00004000</code></td><td class="topAlign">The engine has support for performing perspective transformations on primitives.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PixmapTransform</code></td><td class="topAlign tblval"><code>0x00000004</code></td><td class="topAlign">The engine can transform pixmaps, including rotation and shearing.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PorterDuff</code></td><td class="topAlign tblval"><code>0x00000100</code></td><td class="topAlign">The engine supports Porter-Duff operations</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PrimitiveTransform</code></td><td class="topAlign tblval"><code>0x00000001</code></td><td class="topAlign">The engine has support for transforming drawing primitives.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::RadialGradientFill</code></td><td class="topAlign tblval"><code>0x00000020</code></td><td class="topAlign">The engine supports radial gradient fills.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::RasterOpModes</code></td><td class="topAlign tblval"><code>0x00020000</code></td><td class="topAlign">The engine supports bitwise raster operations.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::AllFeatures</code></td><td class="topAlign tblval"><code>0xffffffff</code></td><td class="topAlign">All of the above features. This enum value is usually used as a bit mask.</td></tr>
</table></div>
<p>The PaintEngineFeatures type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;PaintEngineFeature&gt;. It stores an OR combination of PaintEngineFeature values.</p>
<!-- @@@PaintEngineFeature -->
<!-- $$$PolygonDrawMode$$$OddEvenMode$$$WindingMode$$$ConvexMode$$$PolylineMode -->
<h3 class="fn" id="PolygonDrawMode-enum"><a name="PolygonDrawMode-enum"></a>enum QPaintEngine::<span class="name">PolygonDrawMode</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPaintEngine::OddEvenMode</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The polygon should be drawn using OddEven fill rule.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::WindingMode</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The polygon should be drawn using Winding fill rule.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::ConvexMode</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The polygon is a convex polygon and can be drawn using specialized algorithms where available.</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PolylineMode</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Only the outline of the polygon should be drawn.</td></tr>
</table></div>
<!-- @@@PolygonDrawMode -->
<!-- $$$Type$$$X11$$$Windows$$$QuickDraw$$$CoreGraphics$$$MacPrinter$$$QWindowSystem$$$PostScript$$$OpenGL$$$Picture$$$SVG$$$Raster$$$Direct3D$$$Pdf$$$OpenVG$$$OpenGL2$$$PaintBuffer$$$Blitter$$$Direct2D$$$User$$$MaxUser -->
<h3 class="fn" id="Type-enum"><a name="Type-enum"></a>enum QPaintEngine::<span class="name">Type</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPaintEngine::X11</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Windows</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::MacPrinter</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::CoreGraphics</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">macOS's Quartz2D (CoreGraphics)</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::QuickDraw</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">macOS's QuickDraw</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::QWindowSystem</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">Qt for Embedded Linux</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PostScript</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">(No longer supported)</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::OpenGL</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Picture</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign"><a href="qpicture.html">QPicture</a> format</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::SVG</code></td><td class="topAlign tblval"><code>9</code></td><td class="topAlign">Scalable Vector Graphics XML format</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Raster</code></td><td class="topAlign tblval"><code>10</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Direct3D</code></td><td class="topAlign tblval"><code>11</code></td><td class="topAlign">Windows only, Direct3D based engine</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Pdf</code></td><td class="topAlign tblval"><code>12</code></td><td class="topAlign">Portable Document Format</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::OpenVG</code></td><td class="topAlign tblval"><code>13</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::User</code></td><td class="topAlign tblval"><code>50</code></td><td class="topAlign">First user type ID</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::MaxUser</code></td><td class="topAlign tblval"><code>100</code></td><td class="topAlign">Last user type ID</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::OpenGL2</code></td><td class="topAlign tblval"><code>14</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::PaintBuffer</code></td><td class="topAlign tblval"><code>15</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Blitter</code></td><td class="topAlign tblval"><code>16</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QPaintEngine::Direct2D</code></td><td class="topAlign tblval"><code>17</code></td><td class="topAlign">Windows only, Direct2D based engine</td></tr>
</table></div>
<!-- @@@Type -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPaintEngine[overload1]$$$QPaintEngineQPaintEngine::PaintEngineFeatures -->
<h3 class="fn" id="QPaintEngine"><a name="QPaintEngine"></a>QPaintEngine::<span class="name">QPaintEngine</span>(<span class="type"><a href="qpaintengine.html#PaintEngineFeature-enum">QPaintEngine::PaintEngineFeatures</a></span> <i>caps</i> = PaintEngineFeatures())</h3>
<p>Creates a paint engine with the featureset specified by <i>caps</i>.</p>
<!-- @@@QPaintEngine -->
<!-- $$$~QPaintEngine[overload1]$$$~QPaintEngine -->
<h3 class="fn" id="dtor.QPaintEngine"><a name="dtor.QPaintEngine"></a><code>[virtual] </code>QPaintEngine::<span class="name">~QPaintEngine</span>()</h3>
<p>Destroys the paint engine.</p>
<!-- @@@~QPaintEngine -->
<!-- $$$begin[overload1]$$$beginQPaintDevice* -->
<h3 class="fn" id="begin"><a name="begin"></a><code>[pure virtual] </code><span class="type">bool</span> QPaintEngine::<span class="name">begin</span>(<span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> *<i>pdev</i>)</h3>
<p>Reimplement this function to initialise your paint engine when painting is to start on the paint device <i>pdev</i>. Return true if the initialization was successful; otherwise return false.</p>
<p><b>See also </b><a href="qpaintengine.html#end">end</a>() and <a href="qpaintengine.html#isActive">isActive</a>().</p>
<!-- @@@begin -->
<!-- $$$drawEllipse[overload1]$$$drawEllipseconstQRectF& -->
<h3 class="fn" id="drawEllipse"><a name="drawEllipse"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawEllipse</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>)</h3>
<p>Reimplement this function to draw the largest ellipse that can be contained within rectangle <i>rect</i>.</p>
<p>The default implementation calls <a href="qpaintengine.html#drawPolygon">drawPolygon</a>().</p>
<!-- @@@drawEllipse -->
<!-- $$$drawEllipse$$$drawEllipseconstQRect& -->
<h3 class="fn" id="drawEllipse-1"><a name="drawEllipse-1"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawEllipse</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>)</h3>
<p>The default implementation of this function calls the floating point version of this function</p>
<!-- @@@drawEllipse -->
<!-- $$$drawImage[overload1]$$$drawImageconstQRectF&constQImage&constQRectF&Qt::ImageConversionFlags -->
<h3 class="fn" id="drawImage"><a name="drawImage"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawImage</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rectangle</i>, const <span class="type"><a href="qimage.html">QImage</a></span> &amp;<i>image</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>sr</i>, <span class="type"><a href="../qtcore/qt.html#ImageConversionFlag-enum">Qt::ImageConversionFlags</a></span> <i>flags</i> = Qt::AutoColor)</h3>
<p>Reimplement this function to draw the part of the <i>image</i> specified by the <i>sr</i> rectangle in the given <i>rectangle</i> using the given conversion flags <i>flags</i>, to convert it to a pixmap.</p>
<!-- @@@drawImage -->
<!-- $$$drawLines[overload1]$$$drawLinesconstQLineF*int -->
<h3 class="fn" id="drawLines"><a name="drawLines"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawLines</span>(const <span class="type"><a href="../qtcore/qlinef.html">QLineF</a></span> *<i>lines</i>, <span class="type">int</span> <i>lineCount</i>)</h3>
<p>The default implementation splits the list of lines in <i>lines</i> into <i>lineCount</i> separate calls to <a href="qpaintengine.html#drawPath">drawPath</a>() or <a href="qpaintengine.html#drawPolygon">drawPolygon</a>() depending on the feature set of the paint engine.</p>
<!-- @@@drawLines -->
<!-- $$$drawLines$$$drawLinesconstQLine*int -->
<h3 class="fn" id="drawLines-1"><a name="drawLines-1"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawLines</span>(const <span class="type"><a href="../qtcore/qline.html">QLine</a></span> *<i>lines</i>, <span class="type">int</span> <i>lineCount</i>)</h3>
<p>This is an overloaded function.</p>
<p>The default implementation converts the first <i>lineCount</i> lines in <i>lines</i> to a <a href="../qtcore/qlinef.html">QLineF</a> and calls the floating point version of this function.</p>
<!-- @@@drawLines -->
<!-- $$$drawPath[overload1]$$$drawPathconstQPainterPath& -->
<h3 class="fn" id="drawPath"><a name="drawPath"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawPath</span>(const <span class="type"><a href="qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>The default implementation ignores the <i>path</i> and does nothing.</p>
<!-- @@@drawPath -->
<!-- $$$drawPixmap[overload1]$$$drawPixmapconstQRectF&constQPixmap&constQRectF& -->
<h3 class="fn" id="drawPixmap"><a name="drawPixmap"></a><code>[pure virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawPixmap</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>r</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp;<i>pm</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>sr</i>)</h3>
<p>Reimplement this function to draw the part of the <i>pm</i> specified by the <i>sr</i> rectangle in the given <i>r</i>.</p>
<!-- @@@drawPixmap -->
<!-- $$$drawPoints[overload1]$$$drawPointsconstQPointF*int -->
<h3 class="fn" id="drawPoints"><a name="drawPoints"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawPoints</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> *<i>points</i>, <span class="type">int</span> <i>pointCount</i>)</h3>
<p>Draws the first <i>pointCount</i> points in the buffer <i>points</i></p>
<!-- @@@drawPoints -->
<!-- $$$drawPoints$$$drawPointsconstQPoint*int -->
<h3 class="fn" id="drawPoints-1"><a name="drawPoints-1"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawPoints</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> *<i>points</i>, <span class="type">int</span> <i>pointCount</i>)</h3>
<p>Draws the first <i>pointCount</i> points in the buffer <i>points</i></p>
<p>The default implementation converts the first <i>pointCount</i> QPoints in <i>points</i> to QPointFs and calls the floating point version of drawPoints.</p>
<!-- @@@drawPoints -->
<!-- $$$drawPolygon[overload1]$$$drawPolygonconstQPointF*intQPaintEngine::PolygonDrawMode -->
<h3 class="fn" id="drawPolygon"><a name="drawPolygon"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawPolygon</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> *<i>points</i>, <span class="type">int</span> <i>pointCount</i>, <span class="type"><a href="qpaintengine.html#PolygonDrawMode-enum">QPaintEngine::PolygonDrawMode</a></span> <i>mode</i>)</h3>
<p>Reimplement this virtual function to draw the polygon defined by the <i>pointCount</i> first points in <i>points</i>, using mode <i>mode</i>.</p>
<p><b>Note: </b>At least one of the drawPolygon() functions must be reimplemented.</p><!-- @@@drawPolygon -->
<!-- $$$drawPolygon$$$drawPolygonconstQPoint*intQPaintEngine::PolygonDrawMode -->
<h3 class="fn" id="drawPolygon-1"><a name="drawPolygon-1"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawPolygon</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> *<i>points</i>, <span class="type">int</span> <i>pointCount</i>, <span class="type"><a href="qpaintengine.html#PolygonDrawMode-enum">QPaintEngine::PolygonDrawMode</a></span> <i>mode</i>)</h3>
<p>This is an overloaded function.</p>
<p>Reimplement this virtual function to draw the polygon defined by the <i>pointCount</i> first points in <i>points</i>, using mode <i>mode</i>.</p>
<p><b>Note: </b>At least one of the drawPolygon() functions must be reimplemented.</p><!-- @@@drawPolygon -->
<!-- $$$drawRects[overload1]$$$drawRectsconstQRectF*int -->
<h3 class="fn" id="drawRects"><a name="drawRects"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawRects</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> *<i>rects</i>, <span class="type">int</span> <i>rectCount</i>)</h3>
<p>Draws the first <i>rectCount</i> rectangles in the buffer <i>rects</i>. The default implementation of this function calls <a href="qpaintengine.html#drawPath">drawPath</a>() or <a href="qpaintengine.html#drawPolygon">drawPolygon</a>() depending on the feature set of the paint engine.</p>
<!-- @@@drawRects -->
<!-- $$$drawRects$$$drawRectsconstQRect*int -->
<h3 class="fn" id="drawRects-1"><a name="drawRects-1"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawRects</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> *<i>rects</i>, <span class="type">int</span> <i>rectCount</i>)</h3>
<p>This is an overloaded function.</p>
<p>The default implementation converts the first <i>rectCount</i> rectangles in the buffer <i>rects</i> to a <a href="../qtcore/qrectf.html">QRectF</a> and calls the floating point version of this function.</p>
<!-- @@@drawRects -->
<!-- $$$drawTextItem[overload1]$$$drawTextItemconstQPointF&constQTextItem& -->
<h3 class="fn" id="drawTextItem"><a name="drawTextItem"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawTextItem</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>p</i>, const <span class="type"><a href="qtextitem.html">QTextItem</a></span> &amp;<i>textItem</i>)</h3>
<p>This function draws the text item <i>textItem</i> at position <i>p</i>. The default implementation of this function converts the text to a <a href="qpainterpath.html">QPainterPath</a> and paints the resulting path.</p>
<!-- @@@drawTextItem -->
<!-- $$$drawTiledPixmap[overload1]$$$drawTiledPixmapconstQRectF&constQPixmap&constQPointF& -->
<h3 class="fn" id="drawTiledPixmap"><a name="drawTiledPixmap"></a><code>[virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">drawTiledPixmap</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp;<i>pixmap</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>p</i>)</h3>
<p>Reimplement this function to draw the <i>pixmap</i> in the given <i>rect</i>, starting at the given <i>p</i>. The pixmap will be drawn repeatedly until the <i>rect</i> is filled.</p>
<!-- @@@drawTiledPixmap -->
<!-- $$$end[overload1]$$$end -->
<h3 class="fn" id="end"><a name="end"></a><code>[pure virtual] </code><span class="type">bool</span> QPaintEngine::<span class="name">end</span>()</h3>
<p>Reimplement this function to finish painting on the current paint device. Return true if painting was finished successfully; otherwise return false.</p>
<p><b>See also </b><a href="qpaintengine.html#begin">begin</a>() and <a href="qpaintengine.html#isActive">isActive</a>().</p>
<!-- @@@end -->
<!-- $$$hasFeature[overload1]$$$hasFeatureQPaintEngine::PaintEngineFeatures -->
<h3 class="fn" id="hasFeature"><a name="hasFeature"></a><span class="type">bool</span> QPaintEngine::<span class="name">hasFeature</span>(<span class="type"><a href="qpaintengine.html#PaintEngineFeature-enum">QPaintEngine::PaintEngineFeatures</a></span> <i>feature</i>) const</h3>
<p>Returns <code>true</code> if the paint engine supports the specified <i>feature</i>; otherwise returns <code>false</code>.</p>
<!-- @@@hasFeature -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn" id="isActive"><a name="isActive"></a><span class="type">bool</span> QPaintEngine::<span class="name">isActive</span>() const</h3>
<p>Returns <code>true</code> if the paint engine is actively drawing; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qpaintengine.html#setActive">setActive</a>().</p>
<!-- @@@isActive -->
<!-- $$$paintDevice[overload1]$$$paintDevice -->
<h3 class="fn" id="paintDevice"><a name="paintDevice"></a><span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> *QPaintEngine::<span class="name">paintDevice</span>() const</h3>
<p>Returns the device that this engine is painting on, if painting is active; otherwise returns <code>nullptr</code>.</p>
<!-- @@@paintDevice -->
<!-- $$$painter[overload1]$$$painter -->
<h3 class="fn" id="painter"><a name="painter"></a><span class="type"><a href="qpainter.html">QPainter</a></span> *QPaintEngine::<span class="name">painter</span>() const</h3>
<p>Returns the paint engine's painter.</p>
<!-- @@@painter -->
<!-- $$$setActive[overload1]$$$setActivebool -->
<h3 class="fn" id="setActive"><a name="setActive"></a><span class="type">void</span> QPaintEngine::<span class="name">setActive</span>(<span class="type">bool</span> <i>state</i>)</h3>
<p>Sets the active state of the paint engine to <i>state</i>.</p>
<p><b>See also </b><a href="qpaintengine.html#isActive">isActive</a>().</p>
<!-- @@@setActive -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><code>[pure virtual] </code><span class="type"><a href="qpaintengine.html#Type-enum">QPaintEngine::Type</a></span> QPaintEngine::<span class="name">type</span>() const</h3>
<p>Reimplement this function to return the paint engine <a href="qpaintengine.html#Type-enum">Type</a>.</p>
<!-- @@@type -->
<!-- $$$updateState[overload1]$$$updateStateconstQPaintEngineState& -->
<h3 class="fn" id="updateState"><a name="updateState"></a><code>[pure virtual] </code><span class="type">void</span> QPaintEngine::<span class="name">updateState</span>(const <span class="type"><a href="qpaintenginestate.html">QPaintEngineState</a></span> &amp;<i>state</i>)</h3>
<p>Reimplement this function to update the state of a paint engine.</p>
<p>When implemented, this function is responsible for checking the paint engine's current <i>state</i> and update the properties that are changed. Use the <a href="qpaintenginestate.html#state">QPaintEngineState::state</a>() function to find out which properties that must be updated, then use the corresponding <a href="qpaintenginestate.html#getfunction">get function</a> to retrieve the current values for the given properties.</p>
<p><b>See also </b><a href="qpaintenginestate.html">QPaintEngineState</a>.</p>
<!-- @@@updateState -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
